package com.zhilianbao.leyaogo.model.response.Coupon;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Author: hcy
 * Description:可以使用的优惠券
 * Created: 2016/11/29 16:59
 */
public class CanUseCoupon implements Parcelable{
    private long couponsItemId;// (integer, optional): 主键 优惠券明细编号 ,
    private long couponsId ;//(integer, optional): 所属优惠券 ,
    private String couponsCode;// (string, optional): 优惠券编码 UUID ,
    private int couponsType;// (integer, optional): 优惠券类型 0 现金券 1 折扣券 ,
    private double couponsVal;// (number, optional): 优惠金额/折扣比例1-99 ,
    private double couponsLimitPrice;// (number, optional): 优惠限制金额 多少以上可使用 0 无限制 ,
    private int dayLimit;//(integer, optional): 日期约束方式 0 日期段约束 1 日期天数约束 ,
    private String beginDay;//(string, optional): 优惠券起始时间 ,
    private String endDay;//(string, optional): 优惠券截止时间 ,
    private int dayNumber ;//(integer, optional): 有效天数 ,
    private long userId;//(integer, optional): 优惠券所有者 0 尚未领取 ,
    private String userGetDtm ;//(string, optional): 用户领取时间 ,
    private long orderId;// (integer, optional): 使用订单编号 0 未使用 ,
    private String orderCode;// (string, optional): 使用对应点单号 ,
    private String couponsUseDtm;// (string, optional): 优惠券使用时间 ,
    private int statusCod ;//(integer, optional): 状态 0 未使用 1 已使用 2 已过期 ,
    private String comments;// (string, optional): 备注 ,
    private String createdDtm;// (string, optional),
    private String couponsName;// (string, optional),
    private int couponsLimit;// (integer, optional),
    private String couponsLimitNote;// (string, optional),
    private String couponsGoodsList;// (string, optional),
    private long shopId;// (integer, optional)
    private List<CouponGood> couponsGoods;

    private boolean isCheck;

    public CanUseCoupon(){

    }

    protected CanUseCoupon(Parcel in) {
        couponsItemId = in.readLong();
        couponsId = in.readLong();
        couponsCode = in.readString();
        couponsType = in.readInt();
        couponsVal = in.readDouble();
        couponsLimitPrice = in.readDouble();
        dayLimit = in.readInt();
        beginDay = in.readString();
        endDay = in.readString();
        dayNumber = in.readInt();
        userId = in.readLong();
        userGetDtm = in.readString();
        orderId = in.readLong();
        orderCode = in.readString();
        couponsUseDtm = in.readString();
        statusCod = in.readInt();
        comments = in.readString();
        createdDtm = in.readString();
        couponsName = in.readString();
        couponsLimit = in.readInt();
        couponsLimitNote = in.readString();
        couponsGoodsList = in.readString();
        shopId = in.readLong();
        couponsGoods = in.createTypedArrayList(CouponGood.CREATOR);
        isCheck = in.readByte() != 0;
    }

    public static final Creator<CanUseCoupon> CREATOR = new Creator<CanUseCoupon>() {
        @Override
        public CanUseCoupon createFromParcel(Parcel in) {
            return new CanUseCoupon(in);
        }

        @Override
        public CanUseCoupon[] newArray(int size) {
            return new CanUseCoupon[size];
        }
    };

    public long getCouponsItemId() {
        return couponsItemId;
    }

    public void setCouponsItemId(long couponsItemId) {
        this.couponsItemId = couponsItemId;
    }

    public long getCouponsId() {
        return couponsId;
    }

    public void setCouponsId(long couponsId) {
        this.couponsId = couponsId;
    }

    public String getCouponsCode() {
        return couponsCode;
    }

    public void setCouponsCode(String couponsCode) {
        this.couponsCode = couponsCode;
    }

    public int getCouponsType() {
        return couponsType;
    }

    public void setCouponsType(int couponsType) {
        this.couponsType = couponsType;
    }

    public double getCouponsVal() {
        return couponsVal;
    }

    public void setCouponsVal(double couponsVal) {
        this.couponsVal = couponsVal;
    }

    public double getCouponsLimitPrice() {
        return couponsLimitPrice;
    }

    public void setCouponsLimitPrice(double couponsLimitPrice) {
        this.couponsLimitPrice = couponsLimitPrice;
    }

    public int getDayLimit() {
        return dayLimit;
    }

    public void setDayLimit(int dayLimit) {
        this.dayLimit = dayLimit;
    }

    public String getBeginDay() {
        return beginDay;
    }

    public void setBeginDay(String beginDay) {
        this.beginDay = beginDay;
    }

    public String getEndDay() {
        return endDay;
    }

    public void setEndDay(String endDay) {
        this.endDay = endDay;
    }

    public int getDayNumber() {
        return dayNumber;
    }

    public void setDayNumber(int dayNumber) {
        this.dayNumber = dayNumber;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserGetDtm() {
        return userGetDtm;
    }

    public void setUserGetDtm(String userGetDtm) {
        this.userGetDtm = userGetDtm;
    }

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getCouponsUseDtm() {
        return couponsUseDtm;
    }

    public void setCouponsUseDtm(String couponsUseDtm) {
        this.couponsUseDtm = couponsUseDtm;
    }

    public int getStatusCod() {
        return statusCod;
    }

    public void setStatusCod(int statusCod) {
        this.statusCod = statusCod;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getCreatedDtm() {
        return createdDtm;
    }

    public void setCreatedDtm(String createdDtm) {
        this.createdDtm = createdDtm;
    }

    public String getCouponsName() {
        return couponsName;
    }

    public void setCouponsName(String couponsName) {
        this.couponsName = couponsName;
    }

    public int getCouponsLimit() {
        return couponsLimit;
    }

    public void setCouponsLimit(int couponsLimit) {
        this.couponsLimit = couponsLimit;
    }

    public String getCouponsLimitNote() {
        return couponsLimitNote;
    }

    public void setCouponsLimitNote(String couponsLimitNote) {
        this.couponsLimitNote = couponsLimitNote;
    }

    public String getCouponsGoodsList() {
        return couponsGoodsList;
    }

    public void setCouponsGoodsList(String couponsGoodsList) {
        this.couponsGoodsList = couponsGoodsList;
    }

    public long getShopId() {
        return shopId;
    }

    public void setShopId(long shopId) {
        this.shopId = shopId;
    }

    public List<CouponGood> getCouponsGoods() {
        return couponsGoods;
    }

    public void setCouponsGoods(List<CouponGood> couponsGoods) {
        this.couponsGoods = couponsGoods;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(couponsItemId);
        dest.writeLong(couponsId);
        dest.writeString(couponsCode);
        dest.writeInt(couponsType);
        dest.writeDouble(couponsVal);
        dest.writeDouble(couponsLimitPrice);
        dest.writeInt(dayLimit);
        dest.writeString(beginDay);
        dest.writeString(endDay);
        dest.writeInt(dayNumber);
        dest.writeLong(userId);
        dest.writeString(userGetDtm);
        dest.writeLong(orderId);
        dest.writeString(orderCode);
        dest.writeString(couponsUseDtm);
        dest.writeInt(statusCod);
        dest.writeString(comments);
        dest.writeString(createdDtm);
        dest.writeString(couponsName);
        dest.writeInt(couponsLimit);
        dest.writeString(couponsLimitNote);
        dest.writeString(couponsGoodsList);
        dest.writeLong(shopId);
        dest.writeTypedList(couponsGoods);
        dest.writeByte((byte) (isCheck ? 1 : 0));
    }
}
